import time
import unittest
from selenium import webdriver
from Page import Page
from ddt import ddt,file_data
# 测试用例类
@ddt
class TestCase(unittest.TestCase):
    # 测试固件
    def setUp(self) -> None:
        self.driver=webdriver.Edge()
        self.driver.maximize_window()
    def tearDown(self) -> None:
        time.sleep(10)
        self.driver.quit()
    @file_data('login.yaml')
    def test_01(self,username,password):
        po=Page(self.driver)
        time.sleep(3)
        po.open_url('http://localhost:8080/userlogin')
        po.username(username)
        po.password(password)
        po.loginbtn()
        po.queren()

if __name__ == '__main__':
    unittest.main()
